{% extends 'base_backend.html' %}
{% load static %}
{% load my_filter %}

{% block header_tail %}
<link rel="stylesheet" href="{% static 'zhongbao/zhongbao_admin/css/style.css' %}">
<link rel="stylesheet" href="{% static 'zhongbao/zhongbao_admin/css/iconfont.css' %}">
<link rel="stylesheet" href="{% static 'plugins/datatables/dataTables.bootstrap.css' %}">
<link rel="stylesheet" href="{% static 'public/ComboSelect/css/combo.select.css' %}">
<link rel="stylesheet" href="{% static 'zhongbao/config/css/main.css' %}">
<link rel="stylesheet" href="{% static 'layui/css/layui.css' %}">
<!-- bootstrap datepicker -->
<link rel="stylesheet" href="{% static 'public/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css' %}">
<!-- daterange picker -->
<link rel="stylesheet" href="{% static 'public/bootstrap-daterangepicker/daterangepicker.css' %}">

<script src="{% static 'plugins\jQuery\jquery-2.2.3.min.js' %}"></script>
<script src="{% static 'plugins/vue1/vue.js' %}"></script>
<script src="{% static 'layui/layui.js' %}"></script>
<!-- bootstrap datepicker -->
<script src="{% static 'public/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js' %}"></script>
<!-- date-range-picker -->
<script src="{% static 'public/moment/min/moment.min.js' %}"></script>
<script src="{% static 'public/bootstrap-daterangepicker/daterangepicker.js' %}"></script>

{% endblock header_tail %}

{% block section_content %}
<div>
    <div class="box-header with-border">
        <h3 class="box-title">维护任务报表导出</h3>
    </div>
    <div class="col-md-6">
        <div class="box box-primary">
            <div class="box-header">
                <h3 class="box-title">众包报表导出</h3>
            </div>
            <div class="box-body">
                <form style="margin-top: 10px; display: none" role="form" method="post" action="{% url 'maintain:report_download' 'period' %}">
                    {% csrf_token %}
                    <div class="form-group">
                        <label>周期报表生成:</label>
                        <div class="input-group">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input name="datetime_range" type="text" class="form-control pull-right reservation"
                                   autocomplete="off">
                        </div>
                        <!-- /.input group -->
                    </div>
                    <input type="submit" class="btn btn-primary" value="生成周期报表">
                    <a class="btn btn-success" href="{% url 'maintain:report_download' 'period' %}">下载周期报表</a>
                </form>

                <form style="margin-top: 10px;" role="form" method="post" action="{% url 'maintain:report_download' 'settlement' %}">
                    {% csrf_token %}
                    <div class="form-group">
                        <label>结算报表生成:</label>
                        <div class="input-group date">
                            <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                            </div>
                            <input name="datetime_range" type="text" class="form-control pull-right reservation"
                                   autocomplete="off">
                        </div>
                        <!-- /.input group -->
                    </div>
                    <input type="submit" class="btn btn-primary" value="生成结算报表">
                    <a class="btn btn-success" href="{% url 'maintain:report_download' 'settlement' %}">下载结算报表</a>
                </form>

            </div>
        </div>
    </div>
</div>
<script>
    //Date picker
    $('.datepicker').datepicker({
        autoclose: true,
    });
    //Date range picker
    $('.reservation').daterangepicker();

    function changeColor(id, color) {
        //$(id).parent().parent().parenzhongbao_operationlogst().children().children().children().find("li[color='green']");
        $(id).parent().parent().addClass("active");
        $(id).children().css("color", color);
    }
    //$("#taskManager").addClass("active");
    console.log('{{ is_agent }}')
    if('{{ is_agent }}'==='1'){
          changeColor("#report_export_agent", "#00FF7F");
        }else {
           changeColor("#maintain_report_export_admin", "#00FF7F");
        }
</script>
{% endblock section_content %}
